package com.lh.proxy.dynamic;

public class Client {
    public static void main(String[] args) {

        //创建一个目标对象
        ITeacherDao teacherDao = new TeacherDao();

        //给目标对象创建代理对象
        ProxyFactory proxyFactory = new ProxyFactory(teacherDao);
        ITeacherDao proxyInstance = (ITeacherDao) proxyFactory.getProxyInstance();

        //proxyInstanceclass com.sun.proxy.$Proxy0 内存中动态生成代理对象
        System.out.println("proxyInstance" + proxyInstance.getClass());

        proxyInstance.teach();


    }
}
